from django.core.mail import send_mail
from celery_tasks.main import hw_app


from meiduo import settings

@hw_app.task #发送邮件
def celeryEmail(subject,recipient,html_message):
    # subject, \ 主题
    # message, \ 内容
    # from_email, \ 收件人看到的发件人
    # recipient_list, 列表对方邮箱
    #html_message 针对链接的内容
    send_mail(
        subject=subject,
        message='',
        from_email=settings.EMAIL_FROM,
        recipient_list=[recipient],
        html_message=html_message
    )
